In [1]:
from msdas import *
%pylab inline
matplotlib.rcParams['savefig.dpi'] = 2 * matplotlib.rcParams['savefig.dpi']


Couldn't import dot_parser, loading of dot files will not be possible.
Populating the interactive namespace from numpy and matplotlib

In [2]:
from easydev import gsf

curated_pkn = gsf('msdas', 'data', 'PKN-yeastScaffold.sif')

In [3]:
y = yeast.YEAST2MIDAS(get_yeast_small_data(), get_yeast_raw_data())

In [4]:
y.df.Psite[0:5]


Out[4]:
0         S126+S127
1              S142
2              S272
3         S272^S275
4    S272^T277^S279
Name: Psite, dtype: object

In [5]:
y['GPA1']


Out[5]:
Protein Sequence Psite Sequence_Phospho a0_t0 a0_t1 a0_t5 a0_t10 a0_t20 a0_t45 ... a20_t45 a45_t0 a45_t1 a45_t5 a45_t10 a45_t20 a45_t45 Entry Entry_name Identifier
14 GPA1 SDTDRDAETVTQNEDADRNNSSR S199 SDTDRDAETVTQNEDADRNNS(Phospho)SR 0.000111 0.000101 0.00018 0.000183 0.000127 0.000106 ... 0.000168 0.000082 0.000088 0.000113 0.000143 0.000097 0.000075 P08539 GPA1_YEAST GPA1_S199

1 rows × 43 columns


In [6]:
y.replicates['GPA1']


Out[6]:
Protein Sequence Psite Sequence_Phospho a0_t0 a0_t0.1 a0_t0.2 a0_t1 a0_t1.1 a0_t1.2 ... a45_t10.2 a45_t20 a45_t20.1 a45_t20.2 a45_t45 a45_t45.1 a45_t45.2 Entry Entry_name Identifier
4708 GPA1 MERGED_1Phosphos_3locations_SDTDRDAETVTQNEDADR... T189+S199+S200 MERGED_1Phosphos_3locations_SDTDRDAETVTQNEDADR... 0.000107 0.000103 0.000124 0.000095 0.000102 0.000106 ... 0.000136 0.00009 0.000103 NaN 0.000075 NaN NaN P08539 GPA1_YEAST GPA1_T189+S199+S200

1 rows × 115 columns


In [7]:
y.plot_timeseries("GPA1_S199")
y.replicates.plot_timeseries("GPA1_T189+S199+S200", color="green")
ax = gca()
ax.legend(["small", "raw"])


Out[7]:
<matplotlib.legend.Legend at 0x5b97fd0>

In [8]:
errors = y.get_errors()
errors.ix["GPA1_S199"]


Out[8]:
a0_t0      0.5
a0_t1      0.5
a0_t5      0.5
a0_t10     0.5
a0_t20     0.5
a0_t45     0.5
a1_t0      0.5
a1_t1      0.5
a1_t5      0.5
a1_t10     0.5
a1_t20     0.5
a1_t45     0.5
a5_t0      0.5
a5_t1      0.5
a5_t5      0.5
a5_t10     0.5
a5_t20     0.5
a5_t45     0.5
a10_t0     0.5
a10_t1     0.5
a10_t5     0.5
a10_t10    0.5
a10_t20    0.5
a10_t45    0.5
a20_t0     0.5
a20_t1     0.5
a20_t5     0.5
a20_t10    0.5
a20_t20    0.5
a20_t45    0.5
a45_t0     0.5
a45_t1     0.5
a45_t5     0.5
a45_t10    0.5
a45_t20    0.5
a45_t45    0.5
Name: GPA1_S199, dtype: float64

Here are errors at set to 0.5 (default if NA). This means that errors were NAs or could not be found. The reason for not being found is that labels in the merged raw data are different. We must call a function called cleanup_june


In [9]:
y.cleanup_june()
errors = y.get_errors()
errors.ix["GPA1_T189+S199+S200"]


INFO:root:filling NA with 0.5
57
Out[9]:
a0_t0      0.099538
a0_t1      0.054123
a0_t5      0.094096
a0_t10     0.149148
a0_t20     0.075287
a0_t45     0.500000
a1_t0      0.180624
a1_t1      0.008147
a1_t5      0.170706
a1_t10     0.016397
a1_t20     0.033809
a1_t45     0.500000
a5_t0      0.500000
a5_t1      0.500000
a5_t5      0.500000
a5_t10     0.045989
a5_t20     0.500000
a5_t45     0.675384
a10_t0     0.091016
a10_t1     0.151073
a10_t5     0.144490
a10_t10    0.064962
a10_t20    0.144356
a10_t45    0.059137
a20_t0     0.321291
a20_t1     0.198459
a20_t5     0.178139
a20_t10    0.500000
a20_t20    0.500000
a20_t45    0.500000
a45_t0     0.066963
a45_t1     0.500000
a45_t5     0.500000
a45_t10    0.077377
a45_t20    0.096006
a45_t45    0.500000
Name: GPA1_T189+S199+S200, dtype: float64

In [10]:
y.plot_timeseries_midas('GPA1_T189+S199+S200')


INFO:root:filling NA with 0.5
<matplotlib.figure.Figure at 0x58610d0>

In [11]:
curated_pkn


Out[11]:
'/home/cokelaer/Work/github/msdas/share/data/PKN-yeastScaffold.sif'

In [12]:
preference = -1 # meas no clustering 
c, xm, xme = y.export_pkn_and_midas_june(curated_pkn, tag="test")

In [13]:
c.graph['dpi'] = 200; 
c.plot()
matplotlib.rcParams['savefig.dpi'] = 2 * matplotlib.rcParams['savefig.dpi']



In [14]:
matplotlib.rcParams['savefig.dpi'] = .5 * matplotlib.rcParams['savefig.dpi']
xm.plot()


/home/cokelaer/Work/virtualenv/lib64/python2.7/site-packages/numpy/lib/nanfunctions.py:319: RuntimeWarning: All-NaN slice encountered
  warnings.warn("All-NaN slice encountered", RuntimeWarning)

In [15]:
xm.scale_max_across_experiments()
xm.plot()



In [18]:
c.to_sif("PKN-Yeast-test.sif")
xm.to_midas("MD-Yeast_test_max_byexp.csv")
xme.to_midas("MD-Yeast_test_errors.csv")

In [19]:
xm.reset()  # let us get back the original data to scale with other methods

In [20]:
xm.scale_max_across_experiments()
xm.to_midas("MD-Yeast_test_max_across.csv")

In [23]:
xm.reset()
xm.scale_min_max_across_experiments()
xm.to_midas("MD-Yeast_test_minmax_byexp.csv")

xm.reset()
xm.scale_min_max_across_experiments(1)  # will be renamed 
xm.to_midas("MD-Yeast_test_minmax_across.csv")

In [ ]: